<template>
	<view>
		<view class="edgeInsetTop"></view>
		<view class="cu-list menu sm-border">
			<view class="cu-item arrow" @tap="$wanlshop.auth(`/pages/user/auth/password?event=resetpwd&mobile=${user.mobile}`)">
				<view class="content">
					<text>修改登录密码</text>
				</view>
			</view>
			<!-- <view class="cu-item arrow" @tap="noMobile">
				<view class="content">
					<text>修改手机号码</text>
				</view>
			</view>
			<view class="cu-item arrow" @tap="noPay">
				<view class="content">
					<text>修改支付密码</text>
				</view>
			</view> -->
		</view>
		
		<!-- <view class="cu-list menu sm-border">
			<view class="cu-item arrow">
				<view class="content">
					<text>安全中心</text>
				</view>
			</view>
		</view> -->
		
		<view class="cu-list menu sm-border" @tap="noUser">
			<view class="cu-item arrow">
				<view class="content">
					<text>注销账户</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapState} from 'vuex';
	export default {
		data() {
			return {
			}
		},
		computed: {
			...mapState(['user'])
		},
		methods: {
			noPay(){
				this.$wanlshop.msg('暂无支付密码')
			},
			noUser(){
				this.$api.get({
					url:'/jmy/user/logOff',
					success:res=>{
						this.$wanlshop.msg('注销账户成功')
						this.$store.dispatch('user/logout');
						setTimeout(()=>{
							uni.reLaunch({
								url:'/pages/user/auth/auth'
							})
						},2000)
					}
				})
				
			},
			logout() {
				
				this.$api.post({
					url:'/user/logout',
					success:res=>{
						this.$wanlshop.msg('退出成功')
						this.$store.dispatch('user/logout');
						setTimeout(()=>{
							uni.reLaunch({
								url: '/pages/tabbarcompotant/index/landlord'
							})
						},400)
					}
				})
			
			},
			noMobile(){
				this.$wanlshop.msg('暂不支持修改手机号码')
			}
		}
	}
</script>

<style>
	
</style>
